﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zhaoxi.App.Common.Entity
{
    public class StudentA
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int StudentId { get; set; }
        public string? Name { get; set; }

        public int SchoolId { get; set; }

        [SugarColumn(IsIgnore = true)]
        public SchoolA SchoolA { get; set; }

        [Navigate(NavigateType.Dynamic, null)] //自定义关系映射
        public List<BookA> Books { get; set; } //只能是null 不能赋默认值 
    }

    public class BookA
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int BookId { get; set; }
        public string? Name { get; set; }
        public int studenId { get; set; }
    }





    public class SchoolA
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int SchoolId { get; set; }
        public string? SchoolName { get; set; }
        [SugarColumn(IsIgnore = true)]
        public List<RoomA> RoomList { get; set; }
        [SugarColumn(IsIgnore = true)]
        public List<TeacherA> TeacherList { get; set; }
    }
    public class TeacherA
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int Id { get; set; }
        public int SchoolId { get; set; }
        public string? Name { get; set; }
    }
    public class RoomA
    {
        [SugarColumn(IsPrimaryKey = true)]
        public int RoomId { get; set; }
        public string? RoomName { get; set; }
        public int SchoolId { get; set; }
    }
}
